#ifndef CAR_H
#define CAR_H

#include "car_struct_csv.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>

using namespace boost::posix_time;
using namespace boost::gregorian;

class car
{
  public:
	inline virtual ~car() { }

	// fuel refund for travelling in the period
	//static float find_fuel_refund_unit(int _plate_id, date& _first_date, date& _last_date, bool _include_last_date =true);

	// kilometers in the period
	//static float total_km(int _plate_id, date& _first_date, date& _last_date, bool _include_last_date = true);

	// car power 
	//static float power(int _plate_id = 1);

	// car power range id
	//static int find_power_range_id(int _plate_id = 1);

	// car power range ownership id
	//static int find_power_range_ownership(int _plate_id = 1); 

  private:
};



// implementation for csv files

class car_csv: public car
{
  public:
	
	inline car_csv(char* filename): file(filename)
	{}
	
	inline car_csv(std::string filename): file(filename)
	{}

	car_csv();

	static bool exist(int _id);

	static bool exist(std::string _id);
	
	static float total_km(int _plate_id, date& _first_date, date& _last_date, bool _include_last_date = true);
	
	static float power(int _plate_id = 1);	

	static int find_power_range_id(int _plate_id = 1);	
	
	static int find_power_range_ownership(int _plate_id = 1);	

	static float find_fuel_refund_unit(int _power_range_ownership_id, int _fuel_id, date& _travelling_date);	

	static float find_fuel_refund_unit(int _plate_id, date& _travelling_date);	

	static int ownership(int _plate_id);
	
	static int fuel(int _plate_id);	

  protected:

	static car_struct_csv const find(int _id);
	
	static car_struct_csv const find(std::string _id);	

  private:
	std::string file;
};

#endif
